package com.cxyzy.broadcastdemo

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        button.setOnClickListener {
            val intent = Intent("com.cxyzy.broadcastdemo.bomb")
            intent.setPackage(packageName)
            intent.putExtra("message","我是安卓007")
            sendBroadcast(intent)
        }
    }
}